package com.xdtech.hotel.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.hotel.model.LinkageConfig;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-04-23 20:46:32
 * @since 1.0
 * @see
 */
public class LinkageConfigItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="名称",width=100)
	private String name;
	
	
	private String linkageOperations;

	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	
	public void setName(String name) {
		this.name = name;
		addQuerys("name", name);
	}
	public String getName() {
		return name;
	}
	
	
	
	public String getLinkageOperations() {
		return linkageOperations;
	}
	public void setLinkageOperations(String linkageOperations) {
		this.linkageOperations = linkageOperations;
	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static LinkageConfigItem createItem(LinkageConfig linkageConfig) {
		LinkageConfigItem linkageConfigItem = new LinkageConfigItem();
		BeanUtils.copyProperties(linkageConfigItem, linkageConfig);
		//自定义属性设置填充
		return linkageConfigItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<LinkageConfigItem> createItems(List<LinkageConfig> linkageConfigs) {
		List<LinkageConfigItem> linkageConfigItems = new ArrayList<LinkageConfigItem>();
		for (LinkageConfig linkageConfig : linkageConfigs) {
			linkageConfigItems.add(createItem(linkageConfig));
		}
		return linkageConfigItems;
	}
}
